
//#include "..\SystemInitialData\SystemInformation.h"



/***********************************************
 * not put the data in memory
 * this is for SOC function to use
 ***********************************************/
//#define SOC_BATTERY_OV_VOLTAGE     __2ND_BATTERY_OV_PROTECTION_     //5600
//#define SOC_BATTERY_UV_VOLTAGE     __2ND_BATTERY_UV_PROTECTION_     //3700
//#define SOC_1st_CELL_OV_VOLTAGE     4250 //mV
//#define SOC_1st_CELL_UV_VOLTAGE     2500 //mV


#define OCV_TABLE_POINTS 51
#define NUM_OF_OCV_LINE  6

#define RESIDUAL_CAPACITY_INDEX         0
#define RESIDUAL_DSG_1st_CURRENT_INDEX  1
#define RESIDUAL_DSG_2nd_CURRENT_INDEX  2
#define RESIDUAL_DSG_3rd_CURRENT_INDEX  3
#define RESIDUAL_DSG_4th_CURRENT_INDEX  4
#define RESIDUAL_OCV_CURRENT_INDEX      5
#define RESIDUAL_CHG_1st_CURRENT_INDEX  6


/*
; TERMINAL_VOLTAGE units is mV
; RESIDUAL_CAPACITY units is percentage
; Please sort from largest to smallest
// 2600mAh cell, 25 degree, OCV Table
*/

const unsigned int RealOCVTable[OCV_TABLE_POINTS][NUM_OF_OCV_LINE+1] =
{
////////////// RESIDUAL CAPACITY ////////////////////////////////////////////////////////////////
//10.4Ah      1st       2nd      3rd        4th       OCV        1st 
//Capacity,  DSG 5A,  DSG 7.5A,  DSG 10A,  DSG 15A,    OCV,    CHG 2A,     ///////////////////////
//   (%)      (mV)       (mV)      (mV)      (mV)      (mV)      (mV)
    { 100,    54323,    54313,    54310,    54327,    54405,    54423   },   //index = 00       
    { 98 ,    52338,    51609,    50788,    49541,    54100,    54293   },   //index = 01       
    { 96 ,    52006,    51242,    50374,    49033,    53796,    54161   },   //index = 02       
    { 94 ,    51706,    50933,    50056,    48680,    53523,    54028   },   //index = 03       
    { 92 ,    51421,    50644,    49772,    48393,    53259,    53892   },   //index = 04       
    { 90 ,    51145,    50369,    49509,    48140,    52996,    53759   },   //index = 05       
    { 88 ,    50878,    50105,    49261,    47911,    52750,    53633   },   //index = 06       
    { 86 ,    50618,    49850,    49024,    47697,    52506,    53381   },   //index = 07       
    { 84 ,    50368,    49606,    48797,    47494,    52272,    53139   },   //index = 08       
    { 82 ,    50127,    49372,    48578,    47300,    52059,    52913   },   //index = 09       
    { 80 ,    49895,    49148,    48369,    47114,    51836,    52693   },   //index = 10       
    { 78 ,    49672,    48934,    48167,    46933,    51636,    52484   },   //index = 11       
    { 76 ,    49458,    48729,    47972,    46758,    51443,    52287   },   //index = 12       
    { 74 ,    49253,    48533,    47784,    46588,    51254,    52109   },   //index = 13       
    { 72 ,    49057,    48345,    47603,    46424,    51082,    51938   },   //index = 14       
    { 70 ,    48868,    48166,    47429,    46264,    50909,    51781   },   //index = 15       
    { 68 ,    48689,    47994,    47261,    46110,    50756,    51637   },   //index = 16       
    { 66 ,    48518,    47830,    47100,    45961,    50610,    51506   },   //index = 17       
    { 64 ,    48354,    47672,    46945,    45819,    50460,    51389   },   //index = 18       
    { 62 ,    48198,    47522,    46797,    45683,    50338,    51281   },   //index = 19       
    { 60 ,    48050,    47379,    46656,    45553,    50209,    51182   },   //index = 20       
    { 58 ,    47910,    47242,    46522,    45431,    50018,    51091   },   //index = 21       
    { 56 ,    47779,    47113,    46396,    45315,    49772,    51001   },   //index = 22       
    { 54 ,    47656,    46991,    46277,    45205,    49559,    50897   },   //index = 23       
    { 52 ,    47542,    46877,    46166,    45099,    49375,    50793   },   //index = 24       
    { 50 ,    47436,    46770,    46063,    44998,    49264,    50704   },   //index = 25       
    { 48 ,    47338,    46671,    45966,    44899,    49189,    50628   },   //index = 26       
    { 46 ,    47245,    46577,    45875,    44803,    49112,    50563   },   //index = 27       
    { 44 ,    47154,    46487,    45786,    44709,    49081,    50502   },   //index = 28       
    { 42 ,    47063,    46399,    45700,    44614,    49051,    50445   },   //index = 29       
    { 40 ,    46970,    46311,    45614,    44520,    49026,    50392   },   //index = 30       
    { 38 ,    46872,    46222,    45527,    44423,    49005,    50343   },   //index = 31       
    { 36 ,    46768,    46128,    45436,    44325,    48985,    50296   },   //index = 32       
    { 34 ,    46655,    46029,    45339,    44224,    48961,    50252   },   //index = 33       
    { 32 ,    46530,    45921,    45235,    44118,    48938,    50211   },   //index = 34       
    { 30 ,    46391,    45802,    45122,    44006,    48901,    50172   },   //index = 35       
    { 28 ,    46236,    45670,    44996,    43883,    48824,    50136   },   //index = 36       
    { 26 ,    46063,    45520,    44854,    43744,    48783,    50098   },   //index = 37       
    { 24 ,    45872,    45350,    44691,    43584,    48618,    50051   },   //index = 38       
    { 22 ,    45660,    45154,    44504,    43399,    48453,    49975   },   //index = 39       
    { 20 ,    45425,    44932,    44288,    43185,    48254,    49832   },   //index = 40       
    { 18 ,    45166,    44678,    44040,    42947,    47888,    49561   },   //index = 41       
    { 16 ,    44875,    44399,    43779,    42700,    47534,    49091   },   //index = 42       
    { 14 ,    44602,    44146,    43536,    42453,    47144,    48436   },   //index = 43       
    { 12 ,    44375,    43901,    43284,    42189,    46762,    47851   },   //index = 44       
    { 10 ,    44116,    43627,    43006,    41902,    46428,    47438   },   //index = 45       
    { 8  ,    43821,    43322,    42699,    41583,    46165,    47113   },   //index = 46       
    { 6  ,    43449,    42948,    42303,    41147,    45884,    46833   },   //index = 47       
    { 4  ,    42693,    42256,    41530,    40345,    45314,    46497   },   //index = 48       
    { 2  ,    41050,    40633,    39878,    38737,    43908,    45087   },   //index = 49       
    { 0  ,    37604,    37444,    37555,    37132,    40937,    41039   }    //index = 50  
};                                                            




//#define TERMINAL_VOLTAGE_INDEX 0                            
//#define RESIDUAL_CAPACITY_INDEX 1                           
//                                                            
//const int RealOCVTable[OCV_TABLE_POINTS][2] =               
//{                                                           
//  {  4087,  9994  },    //index=00,  1st                    
//  {  3997,  9496  },    //index=01,  2nd                    
//  {  3941,  8998  },    //index=02,  3rd                    
//  {  3890,  8499  },    //index=03,  4th                    
//  {  3843,  8000  },    //index=04,  5th                    
//  {  3800,  7501  },    //index=05,  6th                    
//  {  3761,  7002  },    //index=06,  7th                    
//  {  3727,  6504  },    //index=07,  8th                    
//  {  3695,  6005  },    //index=08,  9th                    
//  {  3666,  5507  },    //index=09,  10th                   
//  {  3641,  5009  },    //index=10,  11th                   
//  {  3618,  4510  },    //index=11,  12th                   
//  {  3596,  4012  },    //index=12,  13th                   
//  {  3572,  3513  },    //index=13,  14th                   
//  {  3544,  3015  },    //index=14,  15th                   
//  {  3511,  2515  },    //index=15,  16th                   
//  {  3473,  2016  },    //index=16,  17th                   
//  {  3432,  1518  },    //index=17,  18th                   
//  {  3381,  1019  },    //index=18,  19th                   
//  {  3299,  521   },    //index=19,  20th                   
//  {  2748,  0     }     //index=20,  21th                   
//};                                                          
                                                              
                                                              
